package com.ahaoyou.listener;

/**
 * @author LH
 * @create 2022/9/1 15:29
 */
public interface Listener<E extends Event> {
    void onListEvent(E event);
}
class DogListener implements Listener<DogEvent> {

    @Override
    public void onListEvent(DogEvent event) {
        System.out.println("DogListener监听到事件" + event.getSource());
    }
}

class CatListener implements Listener<CatEvent> {

    @Override
    public void onListEvent(CatEvent event) {
        System.out.println("CatListener监听到事件" + event.getSource());
    }
}

class DogTwoListener implements Listener<DogEvent> {

    @Override
    public void onListEvent(DogEvent event) {
        System.out.println("DogTwoListener监听到事件" + event.getSource());
    }
}